using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Common;
using PluginHandler;
using System.Configuration;
using System.Xml.Serialization;

namespace DatabaseManager.StoredConnections
{
    /// <summary>
    /// Describes one settings entry in the <class cref="DatabaseManager.UI.FConnectionManager"/> form.
    /// </summary>
    [Serializable()]
    public class StoredConnection
    {
        private string _plugin;
        private string _connectionName;
        private string _connectionStringBuilder;
        private bool _askForPassword;

        /// <summary>
        /// Gets or sets the name to identify this stored connection.
        /// </summary>
        /// <value>The unique name of this stored connection.</value>
        public string ConnectionName
        {
            get { return _connectionName; }
            set { _connectionName = value; }
        }

        /// <summary>
        /// Gets or sets the name (e.g. SqlPlugin.dll) of the plugin, which is used to connect with the ConfigurationString.
        /// </summary>
        /// <value>The name of the plugin.</value>
        public string PluginName
        {
            get { return _plugin; }
            set { _plugin = value; }
        }

        /// <summary>
        /// Gets or sets the configuration string. The string is get from the choosen plugin configuration control.
        /// </summary>
        /// <value>The configuration string.</value>
        public string ConfigurationString
        {
            get {  return _connectionStringBuilder; }
            set { _connectionStringBuilder = value; }
        }

        public bool AskForPassword
        {
            get { return _askForPassword; }
            set { _askForPassword = value; }
        }
    }
}
